#include "MainManage.h"
#include "../gameManage/GameManage.h"


CMainManage::CMainManage(void)
{
}

CMainManage::~CMainManage(void)
{
}

CCScene* CMainManage::scene()
{
	CCScene * scene = NULL;
	do 
	{
		// 'scene' is an autorelease object
		scene = CCScene::node();
		CC_BREAK_IF(! scene);

		// 'layer' is an autorelease object
		CMainManage *layer = CMainManage::node();
		CC_BREAK_IF(! layer);

		// add layer as a child to scene
		scene->addChild(layer);
	} while (0);

	// return the scene
	return scene;
}
// on "init" you need to initialize your instance
bool CMainManage::init()
{
	bool bRet = false;
	do 
	{
		CC_BREAK_IF(! CCLayer::init());


		bRet = true;
		this->scheduleUpdate();
	} while (0);

	return bRet;
}

void CMainManage::draw()
{
	CCLayer::draw();
}

void CMainManage::update(ccTime dt)
{
	
	CCDirector::sharedDirector()->replaceScene(CGameManage::scene());

	this->unscheduleUpdate();
}

void CMainManage::onEnter()
{
	CCLayer::onEnter();
}

void CMainManage::onExit()
{
	CCLayer::onExit();
}
